import qlibpy

def test1():
    library = qlibpy.Obj.librarys[0]
    print(library.name)
    print(library.unit)
    print()

    error = qlibpy.ErrorCode()
    library = qlibpy.DB.read_gds("E:/T/gds/138bit_line12.gds",1e-9, 0.01, error)

    print(library.name)
    print(library.unit)
    print(library.precision)

    length = qlibpy.CellArray_Size(library.cells)
    for i in range(length):
        print(library.cells[i].name)

    qlibpy.Obj.set_library(library,0)
    print()
    # qlibpy.Obj.librarys[0] = library

def test2():
    library = qlibpy.Obj.librarys[0]

    print(library.name)
    print(library.unit)
    print(library.precision)

    length = qlibpy.CellArray_Size(library.cells)
    for i in range(length):
        print(library.cells[i].name)
    print()

def test3():
    library = qlibpy.Library.create()
    library.name = "ABC"
    library.unit = 200
    qlibpy.Obj.set_library(library,0)